package com.kgc.bage.springboot.service.impl;

import com.kgc.bage.springboot.utils.PinYinUtil;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.kgc.bage.springboot.model.TPhonebook;
import com.kgc.bage.springboot.service.TPhonebookService;

/**
 * 
 * @author bage
 *    TPhonebook业务层实现类
 * @date 2020-12-05 14:00:31
 */
@Service
@Transactional
public class TPhonebookServiceImpl extends BaseServiceImpl<TPhonebook> implements TPhonebookService {
    //重写父类BaseServiceImpl中的save方法
    @Override
    public String save(TPhonebook tPhonebook) throws Exception {
        //设置通讯录数据的姓氏首字母
        tPhonebook.setInitial(PinYinUtil.getFirstByName(tPhonebook.getName()));
        return super.save(tPhonebook);
    }
}
